<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录</title>
<script language="javascript" src="<?=public_js_path();?>jquery.js">
</script>
<script language="javascript">
$(document).ready(function() {
	$("#submit_button").click( function () {
		login();
		return false;
	});
});
function login(){
	$("#login_info").html("<img src='<?=img_path();?>ajaxloading.gif' border=0 />已发送请求,请等待!");
	var username = $.trim($("#username").val());
	var password = $.trim($("#password").val());
	if( username=="" || password=="" ){
		$("#login_info").html('');
		alert("请输入用户名和密码!");
		return false;
	}
	$.ajax({
		type: "POST",
		url: "<?=site_url(array('home','login'));?>",
		data: "username="+username+"&password="+password,
		success: function(str){
			str = jQuery.parseJSON(str);
			if( str.status==1 ){
				$("#login_info").html('');
				return false;
			}else{
				$("#login_info").html('');
				alert(str.info);
				return false;
			}
		}
	});
}
function keydown(e)
{
	var e = e || event;
	if (e.keyCode==13){
		login();
	}
}
</script>
</head>
<body>
    <div class="login_box">
        <div class="log_in">
        <form id="my_form" name="my_form" method="post" action="<?=site_url(array('home','forgot_pwd'));?>">
            <ul class="service">
              <li class="posclear">
                  <div class="registw1 posfloatl">用户名:</div><input type="text" name="username" id="username" />
              </li>
              <li><div class="registw1 posfloatl">密码:</div><input onKeyDown="keydown(event)" id="password" class="password" type="password" /></li>
              <li><input id="submit_button" type="button" value="登陆" />&nbsp;&nbsp;&nbsp;<span id="login_info" style="color:#FF0000"></span></li>
            </ul>
        </form>
        </div>
    </div>
</body>
</html>